<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<script type="text/javascript">

$(function(){
	$("#pager").pager({ pagenumber: ${pageModel.currentPage}, 
						pagecount: ${pageModel.totalPage},
						buttonClickCallback: function(page){
							var fnickName = '${fnickName}';
							var username = '${username}';
							var sex = '${sex}';
							var birthday = '${birthday}';
							var province = '${province}';
							var city = '${city}';
							var district = '${district}';
							var birthPro = '${birthPro}';
							var birthCity = '${birthCity}';
							var birthDic = '${birthDic}'
							var babyName = '${babyName}';
							var tag = '${tag}';
							$("#searh_friend").load("searchFriend.htm",{
								tag:tag,
								fnickName:fnickName,
								username:username,
								sex:sex,
								birthday:birthday,
								babyName:babyName,
								province:province,
								city:city,
								district:district,
								birthPro:birthPro,
								birthCity:birthCity,
								birthDic:birthDic,
								page:page
							});
						} 
	});
});
	function addFriendButton(doorplate){
		$("#add_friend_dialog").load("friendAdd.htm?doorplate="+doorplate);
		$("#add_friend_dialog").show();
	}
	function searchTagName(tagName){
		$("#searh_friend").load("searchFriend.htm",{tag:tagName});
	}
</script>

<div class="h_newNews_box">
	<div class="h_newNews_text" id="con_newNews_1" style="display: block;">
		<div class="success" id="message_send_friend_tip_success"
			style="display: none;">
			<img alt="保存成功" src="images/home_images/ico29.png" />
			邻居请求已发送
		</div>
		<div class="h_findfriends_list pt10">
			<c:choose> 
				<c:when test="${pageModel.totalRecord < 1}">
					没有符合您的条件的邻居
				</c:when>
				<c:otherwise>
					<ul>
						<c:forEach items="${pageModel.list}" var="friendFamily">
							<li>
								<c:if
									test="${friendFamily.doorplate!=member.family && (friendFamily.friendId==null||friendFamily.friendId=='')}">
									<span><a href="javascript:void(0);" class="bn"
										onclick="addFriendButton('${friendFamily.doorplate}');">做邻居</a>
									</span>
								</c:if>
		
								<a href="#" title="进入他的家" onclick="seeOtherFamily('${friendFamily.doorplate}')"><img src="${friendFamily.avatar}"
										width="58" height="58" alt="头像" /> </a>
								<em>家昵称：<a href="javascript:void(0);"
									onclick="seeOtherFamily('${friendFamily.doorplate}')"
									title="进入他的家">${friendFamily.nickname}</a> </em>
		
								<c:if test="${fn:length(friendFamily.fatherList) >0}">
									<p>
										爸 爸：
										<c:forEach items="${friendFamily.fatherList}" var="father">
											<a href="javascript:void(0);" title="查看个人资料">
												${father.friendName} </a>
										</c:forEach>
									</p>
								</c:if>
								<c:if test="${fn:length(friendFamily.motherList) >0}">
									<p>
		
										妈 妈：
										<c:forEach items="${friendFamily.motherList}" var="mother">
											<a href="javascript:void(0);" title="查看个人资料">
												${mother.friendName} </a>
										</c:forEach>
									</p>
								</c:if>
								<c:if test="${fn:length(friendFamily.babyList) >0}">
									<p>
										宝 宝：
										<c:forEach items="${friendFamily.babyList}" var="baby">
											<a href="javascript:void(0);" title="查看个人资料">
												${baby.friendName} </a>
										</c:forEach>
									</p>
								</c:if>
								<c:if test="${fn:length(friendFamily.familyTagList) >0}">
									<p>
										标签：
										<c:forEach items="${friendFamily.familyTagList}" var="familyTag">
											<c:if test="${familyTag.tagName==tag }">
												<a href="javascript:void(0);" style="font-size: 14px;color: green;" title="家的标签">
												${familyTag.tagName} </a>
											</c:if>
											<c:if test="${familyTag.tagName!=tag }">
												<a href="javascript:void(0);" onclick="searchTagName('${familyTag.tagName}')">
												${familyTag.tagName} </a>
											</c:if>
										</c:forEach>
									</p>
								</c:if>
								<div class="clear"></div>
							</li>
						</c:forEach>
		
		
						<div class="clear"></div>
					</ul>
				</c:otherwise>
			</c:choose>
			
			
			<div class="clear"></div>

		</div>
		<div class="h_newNews_text" id="con_newNews_2">
			fdsfsdf
		</div>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<c:if test="${pageModel.totalRecord > 0}">
		<div class="h_page" id="pager"></div>
	</c:if>
	
</div>
<div id="add_friend_dialog" class="addFriend" style="display: none;">

</div>
